home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 14 / Hot Mix 14.iso / HTML / vendors / finesse / examples / sh / software < prev    next >
Text File  |  1996-06-27  |  2KB  |  120 lines

  1. #! /bin/sh
  2. # FINESSEAPPLICATIONKEY sEdDPeUptwYqV
  3. # Skeleton for Script "scsoftware" that puts 
  4. # together a software distribution from data 
  5. # of a Finesse window. Data checking and 
  6. # processing is only indicated.
  7.  
  8. . ${FINESSEPATH-/usr/local/finesse}/fsshinit
  9.  
  10. # Define window and open server
  11. # -----------------------------
  12.  
  13. define_window ()
  14. {
  15.   deutsch=German
  16.   englisch=English
  17.   title="Software Distribution"
  18.   sware="Software:"
  19.   tlimit="Time limit (Months):"
  20.   language=Language:
  21.   htype="Host Type:"
  22.   nrtoday="Series Number:"
  23.   error=Error
  24.   qic="QIC150"
  25.   floppy="Floppy"
  26.   exa=Exabyte
  27.  
  28.   windef="
  29.   FsWindow      -name winname
  30.                 -title '$title'
  31.                 -btype oxa ;
  32.   FsSeparator ;
  33.   FsText        -label Customer 
  34.                 -var customer ;
  35.   FsText        -label '$sware'
  36.                 -var software=PolyScan ;
  37.   FsText        -label '$tlimit'
  38.                 -var nmonths=2;
  39.   FsText        -label '$nrtoday'
  40.                 -var nrheute=1435a34;
  41.   FsSeparator ;
  42.   FsOptionMenu  -label '$htype'
  43.                 -var machine=sun4 
  44.                 -items 'iris4d sun4 rs6000 hp9000s700';
  45.   FsOptionMenu  -label Medium:
  46.                 -var medium=$qic
  47.                 -items '$qic $exa $floppy';
  48.   FsOptionMenu  -label $language
  49.                 -var sprache=$englisch
  50.                 -items '$deutsch $englisch';
  51.   FsSeparator ;"
  52.  
  53. Fsopen "$@"
  54. }
  55.  
  56. # Window dialog:
  57. # Display window, check values, 
  58. # redisplay window on error
  59. # -----------------------------
  60.  
  61. display_window ()
  62. {
  63.  
  64. Fsdisplay -m "$title" -w "$windef"
  65. if [ "$fsbutton" != "o" ] ; then
  66.   Fsclose; exit
  67. else
  68.   while :
  69.   do
  70.     check_vars
  71.     if [ $? -eq 0 ] ; then 
  72.       break 
  73.     else 
  74.       Fsdisplay -n winname -m "$errormessage" 
  75.       if [ "$fsbutton" != "o" ] ; then
  76.         exit
  77.       fi
  78.     fi 
  79.   done
  80. fi ;
  81. }
  82.  
  83.  
  84. check_vars ()
  85. {
  86. # just check time limit, default if not set
  87.  
  88. if [ \( ${nmonths:=2} -lt 2 \) -o \
  89.      \( ${nmonths:=2} -gt 12 \) ] ; then
  90.   errormessage="$error: $tlimit" 
  91.   return 1
  92. fi
  93.  
  94. return 0 ;
  95. }
  96.  
  97. # Process data 
  98. # ------------
  99.  
  100. process_data ()
  101. {
  102. Fssave
  103. Fsecho "OK. Processing. Please wait..."
  104. sleep 3      # Just pretend to do so
  105. Fsecho Done.
  106. sleep 1
  107. Fsclose
  108. exit 0
  109. }
  110.  
  111. # main script
  112. # -----------
  113.  
  114. define_window "$@"
  115. display_window
  116. process_data
  117.  
  118.